package cn.doit.scala.day06.fanxing

/**
 * @DATE 2021/12/31/11:51
 * @Author MDK
 * @Version 2021.2.2
 * */
class Cat(val id:Int, val name:String)extends Ordered[Cat]{
  def this(){
    this(1,"aa_cat")
  }
  override def compare(that: Cat): Int = {
    this.id-that.id
  }

  override def toString = s"Cat($id, $name)"
}
